package gui.data.D3;

import java.awt.Dimension;
import java.awt.GridLayout;

import javax.swing.JLabel;
import javax.swing.JPanel;
import javax.swing.JTextField;

public class PyramidOutputGui extends JPanel {
	
	JLabel volumeLbl, areaLbl, sAreaLbl, bAreaLbl, heightLbl, sHeightLbl, sideLbl;
	JTextField volumeInput, areaInput, bAreaInput, sAreaInput, heightInput, sHeightInput, sideInput;

	public PyramidOutputGui(double volume, double area, double bArea,
			double sArea, double sHeight, double height, double side) {
		this.setLayout(new GridLayout(8, 2));
		this.setPreferredSize(new Dimension(500, 500));
		volumeLbl = new JLabel("Volume = ");
		sAreaLbl = new JLabel("Side area = ");
		bAreaLbl = new JLabel("Bottom area = ");
		areaLbl = new JLabel("Total area = ");
		heightLbl = new JLabel("Height = ");
		sHeightLbl = new JLabel("Side height = ");
		sideLbl = new JLabel("Bottom edge length = ");
		volumeInput = new JTextField(volume == 0 ? "N/A":""+volume);
		sAreaInput = new JTextField(sArea == 0 ? "N/A":""+sArea);
		bAreaInput = new JTextField(bArea == 0 ? "N/A":""+bArea);
		areaInput = new JTextField(area == 0 ? "N/A":""+area);
		heightInput = new JTextField(height == 0 ? "N/A":""+height);
		sHeightInput = new JTextField(sHeight == 0 ? "N/A":""+sHeight);
		sideInput = new JTextField(side == 0 ? "N/A":""+side);
		this.add(sideLbl);
		this.add(sideInput);
		this.add(heightLbl);
		this.add(heightInput);
		this.add(volumeLbl);
		this.add(volumeInput);
		this.add(areaLbl);
		this.add(areaInput);
		this.add(bAreaLbl);
		this.add(bAreaInput);
		this.add(sAreaLbl);
		this.add(sAreaInput);
		this.add(sHeightLbl);
		this.add(sHeightInput);
		this.add(new JLabel());
		volumeInput.setEditable(false);
		areaInput.setEditable(false);
		bAreaInput.setEditable(false);
		sAreaInput.setEditable(false);
		heightInput.setEditable(false);
		sHeightInput.setEditable(false);
		sideInput.setEditable(false);
		
	}

}
